package com.tledu.service.impl;

import com.tledu.dao.AddressDao;
import com.tledu.model.Address;
import com.tledu.service.IAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author cyrus
 */
@Service("addressService")
public class AddressServiceImpl implements IAddressService {
    @Autowired
    private AddressDao addressDao;

    @Override
    public Address selectById(int id) {
        return addressDao.selectById(id);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insert(Address address) {
        int i = addressDao.insert(address);
        int num = 10 / 0;
        return i;
    }
}
